﻿<Window x:Class="IS_Ever_Green.View.ModalWindowAddEmployeeView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:IS_Ever_Green.View" 
        xmlns:viewModel="clr-namespace:IS_Ever_Green.ViewModel"
        mc:Ignorable="d"
        Height="400" 
        Width="400"
        WindowStyle="None"
        ResizeMode="NoResize"
        WindowStartupLocation="CenterScreen"
        Background="Transparent"
        AllowsTransparency="True"
        >
    <Window.DataContext>
        <viewModel:EmployeeViewModel/>
    </Window.DataContext>

    <Border CornerRadius="16">
        <Border CornerRadius="16"
                BorderThickness="3"
                Background="#fff"
                >  

            <Border.BorderBrush>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                    <GradientStop Color="{StaticResource winBorderColor1}" Offset="0.0"/>
                    <GradientStop Color="{StaticResource winBorderColor2}" Offset="0.5"/>
                    <GradientStop Color="{StaticResource winBorderColor3}" Offset="1.0"/>
                </LinearGradientBrush>
            </Border.BorderBrush>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="50"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>

                <TextBlock Text="Добавление сотрудника"
                            Grid.Column="3"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Foreground="{StaticResource primaryTextColor}"
                            FontSize="18"
                            FontWeight="Medium"
                            FontFamily="Montserrat"
                            />

                <StackPanel Grid.Row="2" Margin="10 0 10 10">
                    <StackPanel Orientation="Horizontal" Margin="0 5">
                        <TextBlock Width="100" Text="Логин" VerticalAlignment="Center" Margin="0 0 10 0"/>
                        <TextBox Text="{Binding NewEmployee.LoginUser, UpdateSourceTrigger = PropertyChanged}"
                                  Foreground="{StaticResource primaryTextColor}"
                                  FontSize="25"
                                  FontWeight="Medium"
                                  FontFamily="Montserrat"
                                  CaretBrush="{StaticResource markerColor}"
                                  BorderBrush="{StaticResource primaryTextColor}"
                                  BorderThickness="0 0 0 1"
                                  Height="25"
                                  Width="200"
                                  HorizontalAlignment="Left"
                                  Margin="0 5 0 0"
                                  Padding="30 0 0 0"
                                  >

                            <TextBox.Background>
                                <ImageBrush ImageSource="/Images/User/Login.png"
                                            Stretch="none"
                                            AlignmentX="Left"
                                            /> 
                            </TextBox.Background>
                        </TextBox>
                    </StackPanel>
                    
                    <StackPanel Orientation="Horizontal" Margin="0 5">
                        <TextBlock Width="100" Text="Имя" VerticalAlignment="Center" Margin="0 0 10 0"/>
                        <TextBox Text="{Binding NewEmployee.FirstName, UpdateSourceTrigger = PropertyChanged}"
                                 Foreground="{StaticResource primaryTextColor}"
                                 FontSize="25"
                                 FontWeight="Medium"
                                 FontFamily="Montserrat"
                                 CaretBrush="{StaticResource markerColor}"
                                 BorderBrush="{StaticResource primaryTextColor}"
                                 BorderThickness="0 0 0 1"
                                 Height="25"
                                 Width="200"
                                 HorizontalAlignment="Left"
                                 Margin="0 5 0 0"
                                 Padding="30 0 0 0"
                                 >

                            <TextBox.Background>
                                <ImageBrush ImageSource="/Images/User/UserName_Surname.png"
                                            Stretch="none"
                                            AlignmentX="Left"
                                            />
                            </TextBox.Background>
                        </TextBox>
                    </StackPanel>
                    
                    <StackPanel Orientation="Horizontal" Margin="0 5">
                        <TextBlock Width="100" Text="Фамилия" VerticalAlignment="Center" Margin="0 0 10 0"/>
                        <TextBox Text="{Binding NewEmployee.LastName, UpdateSourceTrigger = PropertyChanged}"
                                 Foreground="{StaticResource primaryTextColor}"
                                 FontSize="25"
                                 FontWeight="Medium"
                                 FontFamily="Montserrat"
                                 CaretBrush="{StaticResource markerColor}"
                                 BorderBrush="{StaticResource primaryTextColor}"
                                 BorderThickness="0 0 0 1"
                                 Height="25"
                                 Width="200"
                                 HorizontalAlignment="Left"
                                 Margin="0 5 0 0"
                                 Padding="30 0 0 0"
                                 >

                            <TextBox.Background>
                                <ImageBrush ImageSource="/Images/User/UserName_Surname.png"
                                            Stretch="none"
                                            AlignmentX="Left"
                                            />
                            </TextBox.Background>
                        </TextBox>
                    </StackPanel>
                    
                    <StackPanel Orientation="Horizontal" Margin="0 5">
                        <TextBlock Width="100" Text="Почта" VerticalAlignment="Center" Margin="0 0 10 0"/>
                        <TextBox Text="{Binding NewEmployee.Email, UpdateSourceTrigger = PropertyChanged}"
                                 Foreground="{StaticResource primaryTextColor}"
                                 FontSize="25"
                                 FontWeight="Medium"
                                 FontFamily="Montserrat"
                                 CaretBrush="{StaticResource markerColor}"
                                 BorderBrush="{StaticResource primaryTextColor}"
                                 BorderThickness="0 0 0 1"
                                 Height="25"
                                 Width="200"
                                 HorizontalAlignment="Left"
                                 Margin="0 5 0 0"
                                 Padding="30 0 0 0"
                                 >

                            <TextBox.Background>
                                <ImageBrush ImageSource="/Images/User/Email.png"
                                            Stretch="none"
                                            AlignmentX="Left"
                                            />
                            </TextBox.Background>
                        </TextBox>
                    </StackPanel>
                    
                    <StackPanel Orientation="Horizontal" Margin="0 5">
                        <TextBlock Width="100" Text="Номер телефона" VerticalAlignment="Center" Margin="0 0 10 0"/>
                        <TextBox Text="{Binding NewEmployee.NumberPhone, UpdateSourceTrigger = PropertyChanged}"
                                 Foreground="{StaticResource primaryTextColor}"
                                 FontSize="25"
                                 FontWeight="Medium"
                                 FontFamily="Montserrat"
                                 CaretBrush="{StaticResource markerColor}"
                                 BorderBrush="{StaticResource primaryTextColor}"
                                 BorderThickness="0 0 0 1"
                                 Height="25"
                                 Width="200"
                                 HorizontalAlignment="Left"
                                 Margin="0 5 0 0"
                                 Padding="30 0 0 0"
                                 >

                            <TextBox.Background>
                                <ImageBrush ImageSource="/Images/User/NumberPhone.png"
                                            Stretch="none"
                                            AlignmentX="Left"
                                            />     
                            </TextBox.Background>
                        </TextBox>
                    </StackPanel>
                    
                    <StackPanel Orientation="Horizontal" Margin="0 5">
                        <TextBlock Width="100" Text="Пароль" VerticalAlignment="Center" Margin="0 0 10 0"/>
                        <TextBox Text="{Binding NewEmployee.Password, UpdateSourceTrigger = PropertyChanged}"
                                 Foreground="{StaticResource primaryTextColor}"
                                 FontSize="25"
                                 FontWeight="Medium"
                                 FontFamily="Montserrat"
                                 CaretBrush="{StaticResource markerColor}"
                                 BorderBrush="{StaticResource primaryTextColor}"
                                 BorderThickness="0 0 0 1"
                                 Height="25"
                                 Width="200"
                                 HorizontalAlignment="Left"
                                 Margin="0 5 0 0"
                                 Padding="30 0 0 0"
                                 >

                            <TextBox.Background>
                                <ImageBrush ImageSource="/Images/User/Password.png"
                                            Stretch="none"
                                            AlignmentX="Left"
                                            />
                            </TextBox.Background>
                        </TextBox>
                    </StackPanel>
                    
                    <StackPanel Orientation="Horizontal" Margin="0 5">
                        <TextBlock Width="100" Text="Адрес" VerticalAlignment="Center" Margin="0 0 10 0"/>
                        <TextBox Text="{Binding NewEmployee.DeliveryAddress, UpdateSourceTrigger = PropertyChanged}"
                                 Foreground="{StaticResource primaryTextColor}"
                                 FontSize="25"
                                 FontWeight="Medium"
                                 FontFamily="Montserrat"
                                 CaretBrush="{StaticResource markerColor}"
                                 BorderBrush="{StaticResource primaryTextColor}"
                                 BorderThickness="0 0 0 1"
                                 Height="25"
                                 Width="200"
                                 HorizontalAlignment="Left"
                                 Margin="0 5 0 0"
                                 Padding="30 0 0 0"
                                 >

                            <TextBox.Background>
                                <ImageBrush ImageSource="/Images/User/Address.png"
                                            Stretch="none"
                                            AlignmentX="Left"
                                            />
                            </TextBox.Background>
                        </TextBox>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal" Margin="0 5">
                        <Button Command="{Binding AddCommand}"
                            Content="Сохранить"
                            Margin="5"
                            BorderThickness="0"
                            Foreground="{StaticResource secondaryTextColor}"
                            FontSize="16"
                            FontFamily="Montserrat"
                            Cursor="Hand"
                            Click="SaveAddEmployee_Click"
                            >
                        
                            <Button.Style>
                                <Style TargetType="Button">
                                    <Setter Property="Background" Value="{StaticResource primaryButtonColor}"/>
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" Value="{StaticResource primaryButtonHoverColor}"/>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>

                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Border Width="100" Height="25"
                                             CornerRadius="5"
                                             Background="{TemplateBinding Background}">

                                        <ContentPresenter VerticalAlignment="Center"
                                     HorizontalAlignment="Center"/>

                                    </Border>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>

                        <Button Command="" 
                                Content="Отмена"
                                Margin="5"
                                BorderThickness="0"
                                Foreground="{StaticResource secondaryTextColor}"
                                FontSize="16"
                                FontFamily="Montserrat"
                                Cursor="Hand"
                                Click="CancelAddEmployee_Click"
                                >       

                            <Button.Style>
                                <Style TargetType="Button">
                                    <Setter Property="Background" Value="{StaticResource primaryButtonColor}"/>
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" Value="{StaticResource primaryButtonHoverColor}"/>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>

                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Border Width="100" Height="25"
                                             CornerRadius="5"
                                             Background="{TemplateBinding Background}">         

                                        <ContentPresenter VerticalAlignment="Center"
                                                            HorizontalAlignment="Center"/>

                                    </Border>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>

                    </StackPanel>
                </StackPanel>

            </Grid>
            
        </Border>
        
    </Border>
</Window>
